es-aggregate-error
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/es-aggregate-error package

1.0.14 • Public • Published

es-aggregate-error Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

ES Proposal spec-compliant shim for AggregateError. Invoke its "shim" method to shim AggregateError if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment, and complies with the proposed spec.

Most common usage:

var assert = require('assert');
var AggregateError = require('es-aggregate-error');

var oneError = new RangeError('hi!');
var otherError = new EvalError('oops');
var error = new AggregateError([oneError, otherError], 'this is two kinds of errors');

assert.deepEqual(error.errors, [oneError, otherError]);
assert.equal(error.message, 'this is two kinds of errors');

AggregateError.shim(); // will be a no-op if not needed

assert.ok(new globalThis.AggregateError([]) instanceof AggregateError);

Tests

Simply clone the repo, npm install, and run npm test

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.140latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.140
1.0.131,292,295
1.0.12105,093
1.0.11108,776
1.0.1010,646
1.0.9157,085
1.0.832,841
1.0.74,165
1.0.60
1.0.5617
1.0.4214
1.0.30
1.0.255
1.0.11
1.0.00

Package Sidebar

Install

npm i es-aggregate-error

Weekly Downloads

1,464,554

Version

1.0.14

License

MIT

Unpacked Size

29.2 kB

Total Files

17

Last publish

Collaborators

  • ljharb